<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/bootstrap.css">
    <link rel="stylesheet" href="/static/dashboard.css">
    <style>
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: middle;
    border-top: 1px solid #ddd;
}
    </style>
    <script src="/static/jquery.min.js"></script>
</head>

<body>


<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">资产管理系统</a>
        </div>

    </div>
</nav>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li {% block user %} {% endblock %}><a href="{% url "user_list" %}">用户表</a></li>
                <li {% block property %}{% endblock %}><a href="{% url "property_list" %}">资产表</a></li>
                <li {% block lab %} {% endblock %}><a href="{% url "lab_list" %}">实验室</a></li>


            </ul>
        </div>

        {% block connet %}

        {% endblock %}
    </div>
</div>
<script src="{% static  "sweetalert.min.js"%}"></script>
<script>
    $(".del").click(function () {
        swal({
  title: "你是否要删除",
  text: "一旦删除将无法恢复",
  icon: "warning",
  buttons: true,
  dangerMode: true,
})
.then((willDelete) => {
  if (willDelete) {
              var pk=$(this).parent().parent()
        $.ajax(
            {
                'url':'{% url "del" %}',
                'type':'get',
                'data':{"pk":$(this).parent().parent().attr("id"),
                    "obj":$(this).attr("name")},
                success:function(ret){
                   pk.remove()
                },
                    error:function (ret) {
                console.log(ret)
            }
            }
        )

    swal("删除成功", {
      icon: "success",
    });
  } else {
    swal("Your imaginary file is safe!");
  }
});})


</script>


</script>

</body>

</html>